import os
from bo.bo import BO

class DepartmentManage(BO):

    def __init__(self, url, token):
        super(DepartmentManage, self).__init__(url, token)
        cur_path = os.path.abspath(os.path.dirname(__file__))  # 获取当前文件目录
        parent_path = os.path.dirname(cur_path)
        self.root_path = os.path.dirname(parent_path)
        self.api_info_path = f'{self.root_path}/api_infos/department_manage.yaml'

    #创建部门
    def create_department(self, params):
        return self.http_request(self.api_info_path, 'create_department', params)

    #更新部门
    def update_department(self, params):
        return self.http_request(self.api_info_path, 'update_department', params)

    #删除部门
    def delete_department(self, params):
        return self.http_request(self.api_info_path, 'delete_department', params)

    #获取部门列表
    def get_department(self, params):
        return self.http_request(self.api_info_path, 'get_department', params)